<?php
/**
 * @Copyright Copyright (C) 2010-2012
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 + Created by:          Webit Solution
 * Company:		Webit Solution
 + Contact:		www.webits.asia, developer@webits.asia
 * Created on:	Mar 21, 2012
 ^
 + Project: 		WRecruit
 * File Name:	views/employer/tmpl/formcompany.php
 ^ 
 * Description: template for form company
 ^ 
 * History:		NONE
 ^ 
 */

defined('_JEXEC') or die('Restricted access');

 global $mainframe;

$editor = & JFactory :: getEditor();
JHTML :: _('behavior.calendar');


 $document =& JFactory::getDocument();
 $document->addStyleSheet('components/com_wrecruit/css/'.$this->config['theme']);

?>
<?php if ($this->config['offline'] == '1'){ ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" >
	<tr><td valign="top" class="<?php echo $this->theme['title']; ?>" >	<?php echo $this->config['title']; ?></td></tr>
	<tr><td height="25"></td></tr>
	<tr><td class="wrecruitmsg">
		<?php echo $this->config['offline_text']; ?>
	</td></tr>
</table>
<?php }else{ ?>
<script language="javascript">
function myValidate(f) {
        if (document.formvalidator.isValid(f)) {
                f.check.value='<?php echo JUtility::getToken(); ?>';//send token
        }
        else {
                alert('Some values are not acceptable.  Please retry.');
				return false;
        }
		return true;
}

</script>

<table cellpadding="0" cellspacing="0" border="0" width="100%" >
	<tr><td valign="top" class="<?php echo $this->theme['title']; ?>" >
		<?php echo $this->config['title']; ?>
	</td>
	</tr>
	<tr><td height="23"></td></tr>
	<?php if ($this->config['cur_location'] == 1) {?>
	<tr><td height="0"></td></tr>
	<tr><td class="curloc">
		<?php echo JText::_('JS_CUR_LOC'); ?> : <?php echo JText::_('JS_JOB_ALERT_UNSUBSCRIBE'); ?>
	</td></tr>
	<?php } ?>
	<tr><td>
		<?php
		if (sizeof($this->jobseekerlinks) != 0){
			echo '<div id="toplinks"><ul>';
			foreach($this->jobseekerlinks as $lnk)	{ ?>
					<span <?php if($lnk[2] == 1)echo 'class="first"'; elseif($lnk[2] == -1)echo 'class="last"';  ?>>
					<a href="<?php echo $lnk[0]; ?>"> <?php echo $lnk[1]; ?></a>
				</span>
			<?php }
			echo '<ul></div>';
		}
		?>
	</td></tr>
	<tr><td height="3"></td></tr>

	<tr><td class="<?php echo $this->theme['heading']; ?>" align="center">
		<?php echo JText::_('JS_UNSUBSCRIBE_JOB_ALERT'); ?>
	</td></tr>

	<tr><td height="10"></td></tr>
</table>
<?php 
if (isset($this->userrole)) if ($this->userrole->rolefor == 2) { // job seeker
	$printform = 1;
}elseif ($this->userrole->rolefor != 1) { // not employer
    if($this->config['overwrite_jobalert_settings'] == 1) $printform = 1;

}else{ // not allowed job posting
	$printform = 0;
	//Update by Vireak on 09/08/2012
	//Add frame to this warning and some styling
	//---------------------
	echo '<div class="box-list"><div class="head-title"><h2>Oop!</h2></div>';
	echo '<span class="wr_info"><p>'.JText::_('JS_YOU_ARE_NOT_ALLOWED_TO_VIEW').'</p>';
	echo '<p>This page is reserved for the authorized candidates only. </p></span>';
	echo '</div>';
	//---------------------
} ?> 
<?php
if ($printform == 1) { // jobseeker
    ?>
<form action="index.php" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data"  onSubmit="return myValidate(this);">
    <table cellpadding="5" cellspacing="0" border="0" width="100%" class="adminform">
		  <tr>
			<td valign="top" align="right"><label id="contactemailmsg" for="contactemail"><?php echo JText::_('JS_CONTACTEMAIL');?></label>&nbsp;<font color="red">*</font></td>
		<?if($this->email){?>
			<td><input class="inputbox required validate-email" type="text" name="contactemail" id="contactemail" size="40" maxlength="100" value="<?php  echo $this->email; ?>" />
			</td>
		<?php  }else{ ?>
			<td><input class="inputbox required validate-email" type="text" name="contactemail" id="contactemail" size="40" maxlength="100" value="" />
			</td>
		<?php  }?>
		  </tr>
	<tr>
		<td colspan="2" align="center">
		<input class="button" type="submit" name="submit_app" value="<?php echo JText::_('JS_UNSUBSCRIBE'); ?>" />
		</td>
	</tr>
    </table>


			<input type="hidden" name="uid" value="<?php echo $this->uid; ?>" />
			<input type="hidden" name="option" value="<?php echo $this->option; ?>" />
			<input type="hidden" name="task" value="unsubscribeJobAlertSetting" />
			<input type="hidden" name="check" value="" />
            <input type="hidden" name="Itemid" id="Itemid" value="<?php echo $this->Itemid; ?>" />
		
		  </form>
			  

		
<?php 
} else{ // not allowed job posting
echo JText::_('JS_YOU_ARE_NOT_ALLOWED_TO_UNSUBSCRIBE_JOBALERT');

}
}//ol
?>
<div width="100%">
<?php include_once('components/com_wrecruit/views/fr_jscr.php'); ?>
</div>

